CFLAGS = -Wall -Wextra -g

all: bitmatrix.o test run_test
bitmatrix.o: bitmatrix.c

test: test.c bitmatrix.o

clean:
	rm -fr *.dSYM *.o test test.current_output.txt

again: clean test bitmatrix.o

run_test: test testfiles/test.valid_output.txt
	@echo ">> Running test"
	@ ./test > test.current_output.txt;
	@echo ">> Diffing results"
	@ diff testfiles/test.valid_output.txt test.current_output.txt;
	@echo ">> Test successful"

.PHONY: all clean again run_test